1. Field of the Invention
The present invention relates to an apparatus, a method, and a computer program, which create a document using acquired data.
2. Description of the Related Art
Various word processor applications have a so-called merge print function in which table data acquired from, for example, a database is inserted into a main document, where a location into which the table data is to be merged is specified, to create and print a new document.
The table data to be merged is specified using a file of a spreadsheet, a table in a database, or a query for data acquisition.
The location in the main document, into which the table data is to be merged, is specified as a merge print field. Data in the merge print field can be used to identify columns in the table data to be merged.
When merge printing is started in, for example, a personal computer (PC), print data to be transmitted to a printer is generated from the document data. Specifically, in the merge printing, the PC reads the document data to detect the merge print field. The PC identifies columns in the table data from column identification information set in the merge print field to acquire data concerning the columns. The PC replaces the data in the merge print field with the acquired data to generate print data (for example, refer to Japanese Patent Laid-Open No. 5-274311).
There is another method of merging data into a template by using a general-purpose template engine Velocity, which is provided by Apache Software Foundation as an open source, to create a document. The Velocity has Velocity Template Language (VTL). Describing the template in the VTL allows data defined outside the template to be merged into the template to create a document. For example, refer to “Velocity User Guide” (http://jakarta.apache.org/velocity/docs/user-guide.html).
In addition, Extensible Stylesheet Language Transformations (XSLT) and XSL Formatting Objects (XSL-FO) technologies of converting acquired Extensible Markup Language (XML) data into a document using a specified stylesheet are also standardized (for example, refer to “Extensible Stylesheet Language (XSL)” Version 1.0, W3C Recommendation, 2001, Oct. 15 <http://www.w3.org/TR/2001/REC-xsl-20011015/> and “XSL Transformations (XSLT)” Version 1.0 W3C Recommendation, 1999, Nov. 16<http://www.w3.org/TR/1999/REC-xslt-19991116>).
In order to embed acquired data into templates or main documents (hereinafter collectively referred to as templates) to create documents, some document generating apparatuses specify combinations of acquired data and templates to create documents.
In such an apparatus, data is acquired only when a merge instruction is issued.
FIG. 1 is a diagram to illustrate a problem associated with a conventional document generating apparatus. It is presumed that an apparatus of creating a document indicating a production output per hour is used in, for example, a factory. The apparatus acquires an accumulated output every hour and calculates a production output by subtracting the accumulated output at a time one hour before the acquisition from the acquired accumulated output to create a table of the calculated production outputs.
Acquisition of pieces of data that are dynamically varied at different points of time and embedding of the acquired pieces of data into a single document may not be realized by using existing functions of the conventional document generating apparatus described above. The above-described conventional document generating apparatus is only capable of generating a document into which one piece of data is embedded when the embedding instruction is issued.
A document may require pieces of data to be acquired at various points of time in one day. However, if a time when the data is required cannot be identified, it may be necessary to accumulate pieces of data at points of time when the data is possibly not used. For example, in order to acquire the data every one minute, it is necessary to accumulate pieces of data at 1,440 (=24×60) points of time per day. If the data is acquired every hour, no data can be generated at points of time between the hours when the data is acquired. In such a case, for example, inference of data from the adjacent pieces of data can result in low-precision data.
As described above, technologies of easily creating documents into which dynamically-varied pieces of data can be embedded may not available.